Skip to content

Support MSC4446: allow moving fully read markers backwards#19663

Open
SpiritCroc wants to merge 9 commits into
element-hq:developfrom
SpiritCroc:msc4446
Open

Support MSC4446: allow moving fully read markers backwards#19663
SpiritCroc wants to merge 9 commits into
element-hq:developfrom
SpiritCroc:msc4446

Conversation

@SpiritCroc

@SpiritCroc SpiritCroc commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

MSC4446

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@MadLittleMods MadLittleMods changed the title Support MSC-4446: allow moving fully read markers backwards Support MSC4446: allow moving fully read markers backwards Apr 7, 2026
@SpiritCroc SpiritCroc marked this pull request as ready for review April 8, 2026 13:00
@SpiritCroc SpiritCroc requested a review from a team as a code owner April 8, 2026 13:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements MSC4446 support in Synapse, allowing clients to move the m.fully_read marker backwards when explicitly opted-in and when the experimental feature flag is enabled.

Changes:

  • Add an experimental config flag (msc4446_enabled) and expose it via /_matrix/client/versions as an unstable feature.
  • Extend the read-marker and receipt endpoints to accept com.beeper.allow_backward (boolean) to allow backwards movement for fully-read markers when enabled.
  • Add client REST tests covering default (forwards-only) behavior, opt-in backwards behavior, and invalid usage.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/rest/client/test_receipts.py Adds tests for backwards movement behavior via the receipts endpoint, including feature-flag gating and invalid usage.
tests/rest/client/test_read_marker.py Adds tests for backwards movement behavior via /read_markers, plus versions endpoint tests for the unstable feature flag.
synapse/rest/client/versions.py Advertises com.beeper.msc4446 in unstable_features based on config.
synapse/rest/client/receipts.py Parses/validates com.beeper.allow_backward (when enabled) and forwards it to the read-marker handler for fully-read receipts.
synapse/rest/client/read_marker.py Parses/validates com.beeper.allow_backward (when enabled) and forwards it to the read-marker handler for m.fully_read.
synapse/handlers/read_marker.py Adds allow_backward support to permit setting m.fully_read to an older event when opted-in.
synapse/config/experimental.py Introduces msc4446_enabled experimental config option.
changelog.d/19663.feature Adds Towncrier newsfragment for the feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 50 to 51
"""Updates the read marker for a given user in a given room if the event ID given
is ahead in the stream relative to the current read marker.
Comment thread changelog.d/19663.feature

@anoadragon453 anoadragon453 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the glacial review time. We're burning down our backlog as a team currently.

Just a couple small things. Otherwise looks pretty good to go!

Comment thread synapse/rest/client/read_marker.py
Comment thread tests/rest/client/test_read_marker.py
Comment thread tests/rest/client/test_read_marker.py
Comment on lines +602 to +603
# MSC4446: Allow moving the fully read marker backwards.
self.msc4446_enabled: bool = experimental.get("msc4446_enabled", False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create an experimental feature issue so we can track this implementation going forwards?

SpiritCroc and others added 6 commits July 8, 2026 13:59
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Conflicts:
	synapse/rest/client/versions.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants